<?php
require dirname(__FILE__) . DIRECTORY_SEPARATOR . '/modular.php';
RegisterPlugin("um_free","ActivePlugin_um_free");


function ActivePlugin_um_free(){
Add_Filter_Plugin('Filter_Plugin_Admin_TopMenu','um_free_AddMenu');
Add_Filter_Plugin('Filter_Plugin_ViewPost_Template','um_free_tags_set');
Add_Filter_Plugin('Filter_Plugin_Zbp_Load','um_free_rebuild_Main');
global $zbp;
$zbp->LoadLanguage('theme', 'um_free');
}


function um_free_AddMenu(&$m){
global $zbp;
	array_unshift($m, MakeTopMenu("root",'主题配置',$zbp->host . "zb_users/theme/um_free/main.php","","topmenu_um_free"));
}

function um_free_tags_set(&$template){
	global $zbp;
    $template->SetTags('um_free_ms',$zbp->Config('um_free')->ms);
    $template->SetTags('um_free_gjc',$zbp->Config('um_free')->gjc);
	$template->SetTags('um_free_zs',$zbp->Config('um_free')->zs);
	$template->SetTags('um_free_fs',$zbp->Config('um_free')->fs);
	$template->SetTags('um_free_w',$zbp->Config('um_free')->w);
}

function InstallPlugin_um_free(){
	global $zbp;
	if(!$zbp->Config('um_free')->HasKey('Version')){
		$zbp->Config('um_free')->Version = '1.2';
		$zbp->Config('um_free')->bn = 'false';
		$zbp->Config('um_free')->ms = '网站描述';
		$zbp->Config('um_free')->gjc = '网站关键词';
		$zbp->Config('um_free')->zs = '6560AB';
		$zbp->Config('um_free')->fs = '7771C9';
		$zbp->Config('um_free')->w = '1000';
		$zbp->SaveConfig('um_free');
	}
}

//卸载主题
function UninstallPlugin_um_free(){
	global $zbp;
}
?>